/*
 * sparse.h
 *
 *  Created on: May 3, 2009
 *      Author: sears
 */

#ifndef JACCARD_DISTANCE_SPARSE_H_
#define JACCARD_DISTANCE_SPARSE_H_
#include <stdint.h>

struct uint128_t {
	unsigned char buf[128/8];
};

struct uint128_vec {
	unsigned int len;
	struct uint128_t vals[100];
};

int cmp_128bit(const struct uint128_t arryA,
		       const struct uint128_t arryB);

/**
 * @param ap a duplicate free, sorted array of 128 bit numbers.
 * @param alen the number of 128 bit numbers in a
 * @param bp analogous to ap
 * @param blen analogous to alen
 * @return the Jaccard distance: 1 - ( a intersect b ) / ( a union b)
 */
double jaccard_distance_sparse(const void * ap, const void * bp);
#endif /* SPARSE_H_ */
